package net.vkits.anjiamiao.domain.repository;

import net.vkits.anjiamiao.domain.model.Order;
import net.vkits.anjiamiao.domain.model.TradeStatus;
import org.springframework.data.repository.PagingAndSortingRepository;

import java.time.LocalDateTime;
import java.util.List;

/**
 * Created by ethan-liu on 2016/11/12.
 */
public interface OrderRepository extends PagingAndSortingRepository<Order, String> {
    Order findByIdAndDeletedFalse(String id);
    List<Order> findByCellPhoneNumAndDeletedFalse(String cellPhoneNum);
    List<Order> findByCellPhoneNumAndCreateTimeGreaterThan(String cellPhoneNum, LocalDateTime month);
    List<Order> findByCellPhoneNumAndFinishedTimeGreaterThan(String cellPhoneNum, LocalDateTime month);
    List<Order> findByCellPhoneNumAndStatusAndDeletedFalse(String cellPhoneNum, TradeStatus status);
}
